Skip to content

RDSessionDeployment: Convert to class-based resource#152

Merged
dan-hughes merged 10 commits intodsccommunity:mainfrom
dan-hughes:f/class-RDSessionDeployment
Apr 2, 2026
Merged

RDSessionDeployment: Convert to class-based resource#152
dan-hughes merged 10 commits intodsccommunity:mainfrom
dan-hughes:f/class-RDSessionDeployment

Conversation

@dan-hughes
Copy link
Copy Markdown
Contributor

@dan-hughes dan-hughes commented Mar 27, 2026

Pull Request (PR) description

Convert RDSessionDeployment to class based resource.

  • Interface/Schema has changed but is forward compatible. WebAccessServer is now not a mandatory parameter to match the underlying cmdlet.
    Add required configuration and modules for class based resources.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the file CHANGELOG.md.
    Entry should say what was changed and how that affects users (if applicable), and
    reference the issue being resolved (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof and comment-based
    help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Converts RDSessionDeployment from a legacy function-based DSC resource to a class-based ResourceBase implementation, adds RDSReason class and en-US localized strings, removes legacy module/schema/tests, introduces a prefix import script and DscResource.Base dependency, updates build/manifest/export settings, and adds new class-focused unit tests.

Changes

Cohort / File(s) Summary
Build & Manifest
RequiredModules.psd1, build.yaml, source/RemoteDesktopServicesDsc.psd1
Add DscResource.Base requirement; add global prefix.ps1 prefix and copy-only nested module entry for DscResource.Base; exclude DscResource.Base from coverage; change CmdletsToExport from @() to '*'.
Prefix / Bootstrapping
source/prefix.ps1
New prefix script imports DscResource.Base, imports common helper modules, and initializes $script:localizedData.
New classes
source/Classes/001.RDSReason.ps1, source/Classes/020.RDSessionDeployment.ps1
Add RDSReason class and RDSessionDeployment : ResourceBase with DSC properties, Get/Set/Test lifecycle methods, GetCurrentState, Modify, AddRole/RemoveRole, AssertProperties, and localization usage.
Removed legacy resource & schema
source/DSCResources/DSC_RDSessionDeployment/DSC_RDSessionDeployment.psm1, .../DSC_RDSessionDeployment.schema.mof, .../README.md, .../en-US/DSC_RDSessionDeployment.strings.psd1
Remove legacy function-based DSC resource implementation, MOF schema, README and old localization file.
Localization
source/en-US/RDSessionDeployment.strings.psd1
Add en-US localized strings for RDSessionDeployment messages and OS-requirement error.
Examples
source/Examples/Resources/RDSessionDeployment/1-CreateSessionDeployment.ps1, .../1-RDSessionDeployment_Full.ps1
Adjust DSC import syntax/formatting in examples to match new class-based usage.
Module root
source/RemoteDesktopServicesDsc.psm1
Remove placeholder comment; file left empty in this diff.
Tests — added
tests/Unit/Classes/RDSReason.Tests.ps1, tests/Unit/Classes/RDSessionDeployment.Tests.ps1
Add Pester unit tests for RDSReason and RDSessionDeployment covering construction, lifecycle methods, helpers, and assertions.
Tests — removed
tests/Unit/DSC_RDSessionDeployment.Tests.ps1
Remove legacy Pester suite that tested the function-based DSC resource.
Changelog
CHANGELOG.md
Document conversion of RDSessionDeployment to class-based resource and note WebAccessServer is no longer required.

Sequence Diagram(s)

sequenceDiagram
    participant L as Local DSC Engine
    participant C as RDSessionDeployment (class)
    participant B as ResourceBase
    participant R as RemoteDesktop Module
    L->>C: Invoke Get/Test/Set
    C->>B: Delegate lifecycle handling (Normalize/GetCurrentState/Assert)
    C->>R: Call Get-RDServer / Add-RDServer / Remove-RDServer / New-RDSessionDeployment
    R-->>C: Return server lists / command results
    C->>B: Call Set-DscMachineRebootRequired when needed
    C-->>L: Return compliance/state result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'RDSessionDeployment: Convert to class-based resource' clearly and concisely summarizes the main change in the pull request.
Description check ✅ Passed The PR description provides relevant context about converting RDSessionDeployment to a class-based resource, interface changes, and WebAccessServer parameter optionality.
Linked Issues check ✅ Passed The PR successfully addresses issue #151 by converting RDSessionDeployment to a class-based resource with forward-compatible interface and optional WebAccessServer parameter.
Out of Scope Changes check ✅ Passed All changes are directly related to converting RDSessionDeployment to a class-based resource and supporting infrastructure, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97%. Comparing base (7587a76) to head (0f119b0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #152   +/-   ##
===================================
  Coverage    97%    97%           
===================================
  Files         9     10    +1     
  Lines       536    537    +1     
===================================
+ Hits        523    525    +2     
+ Misses       13     12    -1     
Files with missing lines Coverage Δ
source/Classes/020.RDSessionDeployment.ps1 100% <100%> (ø)
source/prefix.ps1 100% <100%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (3)
source/prefix.ps1 (1)

4-9: Inconsistent path separators.

Line 4 uses backslash (Modules\DscResource.Common) while line 8 uses forward slash (Modules/RemoteDesktopServicesDsc.Common). While PowerShell handles both on Windows, consider using a consistent separator throughout for readability.

Suggested fix for consistency
 # Import nested, 'DscResource.Common' module
 $script:dscResourceCommonModulePath = Join-Path -Path $PSScriptRoot -ChildPath 'Modules\DscResource.Common'
 Import-Module -Name $script:dscResourceCommonModulePath

 # TODO: The goal would be to remove this, when no classes and public or private functions need it.
-$script:remoteDesktopServicesDscCommonModulePath = Join-Path -Path $PSScriptRoot -ChildPath 'Modules/RemoteDesktopServicesDsc.Common'
+$script:remoteDesktopServicesDscCommonModulePath = Join-Path -Path $PSScriptRoot -ChildPath 'Modules\RemoteDesktopServicesDsc.Common'
 Import-Module -Name $script:remoteDesktopServicesDscCommonModulePath
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/prefix.ps1` around lines 4 - 9, The two module path variables
($script:dscResourceCommonModulePath and
$script:remoteDesktopServicesDscCommonModulePath) use mixed path separators;
normalize them by using Join-Path consistently for both child paths (e.g.,
replace 'Modules/RemoteDesktopServicesDsc.Common' with
'Modules\RemoteDesktopServicesDsc.Common' or vice versa) so both Import-Module
calls are constructed with the same separator style and readability is
consistent; update the Join-Path childPath argument for the
remoteDesktopServicesDscCommonModulePath to match the pattern used for
dscResourceCommonModulePath.
tests/Unit/Classes/RDSReason.Tests.ps1 (2)

60-68: Missing Set-StrictMode -Version 1.0 in InModuleScope block.

Proposed fix
         It 'Should be able to set value in instance' {
             $script:mockRDSReasonInstance = InModuleScope -ScriptBlock {
+                Set-StrictMode -Version 1.0
+
                 $RDSReasonInstance = [RDSReason]::new()

                 $RDSReasonInstance.Code = 'RDSReason:RDSReason:Ensure'
                 $RDSReasonInstance.Phrase = 'The property Ensure should be "Present", but was "Absent"'

                 return $RDSReasonInstance
             }
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Unit/Classes/RDSReason.Tests.ps1` around lines 60 - 68, Add
Set-StrictMode -Version 1.0 at the start of the InModuleScope -ScriptBlock so
the test runs with strict mode enabled; specifically, inside the block that
constructs $RDSReasonInstance (the block using [RDSReason]::new() and assigning
.Code and .Phrase), insert the strict mode call before creating
$RDSReasonInstance to ensure undefined variables/typos are caught during the
RDSReasonInstance setup.

46-56: Missing Set-StrictMode -Version 1.0 in InModuleScope blocks.

As per coding guidelines, Set-StrictMode -Version 1.0 should be added immediately before invoking the tested function/class inside InModuleScope blocks.

Proposed fix
     Context 'When instantiating the class' {
         It 'Should not throw an error' {
             $script:mockRDSReasonInstance = InModuleScope -ScriptBlock {
+                Set-StrictMode -Version 1.0
+
                 [RDSReason]::new()
             }
         }

         It 'Should be of the correct type' {
+            InModuleScope -ScriptBlock {
+                Set-StrictMode -Version 1.0
+            }
+
             $mockRDSReasonInstance | Should -Not -BeNullOrEmpty
             $mockRDSReasonInstance.GetType().Name | Should -Be 'RDSReason'
         }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Unit/Classes/RDSReason.Tests.ps1` around lines 46 - 56, The
InModuleScope scriptblocks that instantiate the class must enable strict mode;
add a call to Set-StrictMode -Version 1.0 as the first statement inside each
InModuleScope -ScriptBlock before invoking the tested code (e.g., before
[RDSReason]::new() in the block that creates $script:mockRDSReasonInstance and
any other InModuleScope blocks in the RDSReason tests). Ensure the
Set-StrictMode call is placed inside the scriptblock so it applies to the code
under test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 11: Update the changelog entry that currently reads "Converted to class
based resource" to use hyphenated wording "class-based" for correct grammar;
locate the line containing the phrase "Converted to class based resource [Issue
`#151`]" and replace "class based" with "class-based" so the entry reads
"Converted to class-based resource [Issue `#151`]".

In `@source/Classes/020.RDSessionDeployment.ps1`:
- Around line 40-42: The RDSessionDeployment constructor currently doesn't
initialize the $this.ExcludeDscProperties array; update the RDSessionDeployment
() : base ($PSScriptRoot) constructor to set $this.ExcludeDscProperties to an
empty array (or the required default values) so the property is always defined
per coding guidelines—locate the RDSessionDeployment constructor and add
initialization of $this.ExcludeDscProperties there.
- Line 21: The DSC class attribute `[DscResource()]` on the RDSessionDeployment
class is missing the RunAsCredential setting; update the attribute to include a
RunAsCredential value (e.g., change `[DscResource()]` to
`[DscResource(RunAsCredential = 'Optional')]` or `'Mandatory'` as required for
RDSessionDeployment) so the class-based resource declares its run-as credential
policy; locate the `[DscResource]` attribute above the RDSessionDeployment class
and replace it with the appropriate form.
- Around line 5-6: The .DESCRIPTION block for the DSC class resource
RDSessionDeployment is missing the required "## Requirements" and "## Known
issues" subsections; update the comment-based help in the .DESCRIPTION for the
RDSessionDeployment resource to add a "## Requirements" section listing
prerequisites (PowerShell/DSC versions, modules) and a "## Known issues" section
that includes a link to the repository's open issues page on GitHub and any
current caveats; ensure these headings are included in the same .DESCRIPTION
comment block so the DSC class-based resource follows the coding guidelines.

In `@source/en-US/RDSessionDeployment.strings.psd1`:
- Around line 4-6: Remove the literal single-quote characters that were included
in the localized values for RDSessionDeployment_OSRequirementNotMet,
RDSessionDeployment_AddingToDeployment, and
RDSessionDeployment_RemovingFromDeployment so the stored strings are plain
message text (e.g. The minimum OS requirement was not met. (RDSD0001)) and for
messages with placeholders (RDSessionDeployment_AddingToDeployment and
RDSessionDeployment_RemovingFromDeployment) ensure they use the
ConvertFrom-StringData placeholder syntax with {0}, {1} intact and no
surrounding quotes.

In `@source/RemoteDesktopServicesDsc.psd1`:
- Line 33: Replace the wildcard export by setting CmdletsToExport to an empty
array: update the manifest entry for CmdletsToExport (currently "'*'") to @() so
the module does not export any cmdlets; this should match the existing
FunctionsToExport (empty) and the nested module RemoteDesktopServicesDsc.Common
and follow DSC resource module best practices.

In `@tests/Unit/Classes/RDSessionDeployment.Tests.ps1`:
- Around line 303-313: The two test-case hashtables for Property =
'WebAccessServer' (one with Current = $null and the next with Current =
'webaccess.lan') are missing a separating comma; insert a comma after the
closing brace of the first hashtable so the array of hashtables is syntactically
valid (i.e., add a comma between the hashtable ending with Desired =
[System.String[]] @('webaccess1.lan', 'webaccess3.lan') and the following
hashtable).

In `@tests/Unit/Classes/RDSReason.Tests.ps1`:
- Line 59: The Context description string "When setting an reading values"
contains a typo; update the Context declaration in the test (the Context block
whose title is "When setting an reading values") to "When setting and reading
values" so the test description reads correctly.
- Around line 71-74: The test "It 'Should be able read the values from
instance'" mistakenly assigns to $mockRDSReasonInstance.Phrase instead of
asserting its value; replace the assignment ($mockRDSReasonInstance.Phrase =
'...') with an assertion that pipes the property into Should -Be with the
expected string (e.g., $mockRDSReasonInstance.Phrase | Should -Be 'The property
Ensure should be "Present", but was "Absent"') so the test actually verifies the
Phrase property.

---

Nitpick comments:
In `@source/prefix.ps1`:
- Around line 4-9: The two module path variables
($script:dscResourceCommonModulePath and
$script:remoteDesktopServicesDscCommonModulePath) use mixed path separators;
normalize them by using Join-Path consistently for both child paths (e.g.,
replace 'Modules/RemoteDesktopServicesDsc.Common' with
'Modules\RemoteDesktopServicesDsc.Common' or vice versa) so both Import-Module
calls are constructed with the same separator style and readability is
consistent; update the Join-Path childPath argument for the
remoteDesktopServicesDscCommonModulePath to match the pattern used for
dscResourceCommonModulePath.

In `@tests/Unit/Classes/RDSReason.Tests.ps1`:
- Around line 60-68: Add Set-StrictMode -Version 1.0 at the start of the
InModuleScope -ScriptBlock so the test runs with strict mode enabled;
specifically, inside the block that constructs $RDSReasonInstance (the block
using [RDSReason]::new() and assigning .Code and .Phrase), insert the strict
mode call before creating $RDSReasonInstance to ensure undefined variables/typos
are caught during the RDSReasonInstance setup.
- Around line 46-56: The InModuleScope scriptblocks that instantiate the class
must enable strict mode; add a call to Set-StrictMode -Version 1.0 as the first
statement inside each InModuleScope -ScriptBlock before invoking the tested code
(e.g., before [RDSReason]::new() in the block that creates
$script:mockRDSReasonInstance and any other InModuleScope blocks in the
RDSReason tests). Ensure the Set-StrictMode call is placed inside the
scriptblock so it applies to the code under test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81fdff2e-c4fc-469b-a9fe-11b7794d5286

📥 Commits

Reviewing files that changed from the base of the PR and between e1fffc5 and a610ce1.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • RequiredModules.psd1
  • build.yaml
  • source/Classes/001.RDSReason.ps1
  • source/Classes/020.RDSessionDeployment.ps1
  • source/DSCResources/DSC_RDSessionDeployment/DSC_RDSessionDeployment.psm1
  • source/DSCResources/DSC_RDSessionDeployment/DSC_RDSessionDeployment.schema.mof
  • source/DSCResources/DSC_RDSessionDeployment/README.md
  • source/DSCResources/DSC_RDSessionDeployment/en-US/DSC_RDSessionDeployment.strings.psd1
  • source/Examples/Resources/RDSessionDeployment/1-CreateSessionDeployment.ps1
  • source/Examples/Resources/RDSessionDeployment/1-RDSessionDeployment_Full.ps1
  • source/RemoteDesktopServicesDsc.psd1
  • source/RemoteDesktopServicesDsc.psm1
  • source/en-US/RDSessionDeployment.strings.psd1
  • source/prefix.ps1
  • tests/Unit/Classes/RDSReason.Tests.ps1
  • tests/Unit/Classes/RDSessionDeployment.Tests.ps1
  • tests/Unit/DSC_RDSessionDeployment.Tests.ps1
💤 Files with no reviewable changes (6)
  • source/DSCResources/DSC_RDSessionDeployment/README.md
  • source/RemoteDesktopServicesDsc.psm1
  • source/DSCResources/DSC_RDSessionDeployment/en-US/DSC_RDSessionDeployment.strings.psd1
  • source/DSCResources/DSC_RDSessionDeployment/DSC_RDSessionDeployment.schema.mof
  • tests/Unit/DSC_RDSessionDeployment.Tests.ps1
  • source/DSCResources/DSC_RDSessionDeployment/DSC_RDSessionDeployment.psm1

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
source/Classes/020.RDSessionDeployment.ps1 (1)

76-80: Consider selecting single value for ConnectionBroker defensively.

Line 78 returns ConnectionBroker from a .Where() clause without ensuring a single value. While typically only one Connection Broker exists per deployment, the .Server property could return an array if multiple servers have the RDS-CONNECTION-BROKER role, causing a type mismatch with the [System.String] property.

For consistency with line 94 in Modify() (which uses Select-Object -First 1 for WebAccessServer), consider applying the same pattern here.

Proposed fix
         return @{
             SessionHost      = [System.String[]] ($deployed.Where({ $_.Roles -contains 'RDS-RD-SERVER' })).Server
-            ConnectionBroker = ($deployed.Where({ $_.Roles -contains 'RDS-CONNECTION-BROKER' })).Server
+            ConnectionBroker = ($deployed.Where({ $_.Roles -contains 'RDS-CONNECTION-BROKER' })).Server | Select-Object -First 1
             WebAccessServer  = [System.String[]] ($deployed.Where({ $_.Roles -contains 'RDS-WEB-ACCESS' })).Server
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/Classes/020.RDSessionDeployment.ps1` around lines 76 - 80, The
ConnectionBroker return value is taken from ($deployed.Where({ $_.Roles
-contains 'RDS-CONNECTION-BROKER' })).Server which can produce an array if
multiple servers match; change the construction to defensively select a single
server (e.g., use Select-Object -First 1 or index [0] and cast to
[System.String]) so ConnectionBroker is always a single string like
WebAccessServer is in Modify(); update the return hash's ConnectionBroker
expression accordingly, referencing the existing deployed variable, Roles,
Server property and the Modify() pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@source/Classes/020.RDSessionDeployment.ps1`:
- Around line 76-80: The ConnectionBroker return value is taken from
($deployed.Where({ $_.Roles -contains 'RDS-CONNECTION-BROKER' })).Server which
can produce an array if multiple servers match; change the construction to
defensively select a single server (e.g., use Select-Object -First 1 or index
[0] and cast to [System.String]) so ConnectionBroker is always a single string
like WebAccessServer is in Modify(); update the return hash's ConnectionBroker
expression accordingly, referencing the existing deployed variable, Roles,
Server property and the Modify() pattern.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: de81ddde-620a-4a0e-8764-1e219bbfa692

📥 Commits

Reviewing files that changed from the base of the PR and between a610ce1 and 7a5341c.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • source/Classes/020.RDSessionDeployment.ps1
  • source/en-US/RDSessionDeployment.strings.psd1
  • tests/Unit/Classes/RDSReason.Tests.ps1
  • tests/Unit/Classes/RDSessionDeployment.Tests.ps1
✅ Files skipped from review due to trivial changes (3)
  • CHANGELOG.md
  • source/en-US/RDSessionDeployment.strings.psd1
  • tests/Unit/Classes/RDSReason.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/Unit/Classes/RDSessionDeployment.Tests.ps1

@dan-hughes dan-hughes requested a review from raandree March 27, 2026 12:09
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
source/prefix.ps1 (1)

7-7: Track TODO with an issue reference.

Line 7 has a TODO in bootstrap code. Please attach an issue ID (or milestone) in the comment so this cleanup doesn’t become orphaned.

Do you want me to draft the issue text for this cleanup item?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/prefix.ps1` at line 7, Update the TODO comment in source/prefix.ps1
(the line containing "TODO: The goal would be to remove this, when no classes
and public or private functions need it.") to include a tracker reference (issue
ID or milestone) and short issue link or number (e.g., "#1234" or
"issue:repo#1234"); ensure the comment briefly states the cleanup task and the
tracker reference so the TODO is not orphaned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@source/prefix.ps1`:
- Around line 5-9: The Import-Module calls that load the nested modules
($script:dscResourceCommonModulePath and
$script:remoteDesktopServicesDscCommonModulePath) should fail fast on errors;
update the two Import-Module invocations in prefix.ps1 to include the
-ErrorAction Stop parameter so that any import failure throws and prevents
partial/quiet initialization of the module.
- Line 1: The build fails because source/prefix.ps1 contains "using module
.\Modules\DscResource.Base" which requires the DscResource.Base module to exist
at parse-time; fix this by reordering the build pipeline in build.yaml so nested
modules are copied before parsing the main module — specifically ensure the task
sequence runs Build_NestedModules_ModuleBuilder before
Build_Module_ModuleBuilder (e.g., in the build steps run Clean,
Build_NestedModules_ModuleBuilder, Build_Module_ModuleBuilder,
Create_changelog_release_output) so the Modules/DscResource.Base is present when
the module parser runs.

---

Nitpick comments:
In `@source/prefix.ps1`:
- Line 7: Update the TODO comment in source/prefix.ps1 (the line containing
"TODO: The goal would be to remove this, when no classes and public or private
functions need it.") to include a tracker reference (issue ID or milestone) and
short issue link or number (e.g., "#1234" or "issue:repo#1234"); ensure the
comment briefly states the cleanup task and the tracker reference so the TODO is
not orphaned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28e36e7d-69d5-4106-b2a7-8fdafd2af738

📥 Commits

Reviewing files that changed from the base of the PR and between 7a5341c and 767458a.

📒 Files selected for processing (1)
  • source/prefix.ps1

@dan-hughes dan-hughes enabled auto-merge (squash) April 2, 2026 15:16
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@source/Classes/020.RDSessionDeployment.ps1`:
- Around line 76-80: The ConnectionBroker return can be an array when multiple
brokers exist; update the return so ConnectionBroker yields a single
System.String by selecting a single Server from the filtered $deployed (e.g.,
use Select-Object -First 1 or index into the .Where(...) result) and cast it to
[System.String] in the returned hashtable (refer to the ConnectionBroker
property in the return block and the .Where({ $_.Roles -contains
'RDS-CONNECTION-BROKER' }).Server expression).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e51f4dcb-2167-4f61-96e7-ce6b19498d96

📥 Commits

Reviewing files that changed from the base of the PR and between f67ffda and 0f119b0.

📒 Files selected for processing (1)
  • source/Classes/020.RDSessionDeployment.ps1

@dan-hughes dan-hughes merged commit f97b34e into dsccommunity:main Apr 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDSessionDeployment - Convert to Class-Based

1 participant